Skip to content

docs(workflows): MCP triggering — tools, flow and trigger settings (PRD-742) - #21

Open
christophebrun-forest wants to merge 1 commit into
mainfrom
feature/prd-742-mcp-workflow-tools-docs
Open

docs(workflows): MCP triggering — tools, flow and trigger settings (PRD-742)#21
christophebrun-forest wants to merge 1 commit into
mainfrom
feature/prd-742-mcp-workflow-tools-docs

Conversation

@christophebrun-forest

@christophebrun-forest christophebrun-forest commented Aug 3, 2026

Copy link
Copy Markdown
Member

Documents the MCP trigger channel shipped by PRD-49, closing the docs half of PRD-742.

Written from the implementation in the three feature branches (front #9870, mcp-server #1792, orchestrator #8418), not from the spec — see Deviations below.

What changed

product/embed/mcp-server.mdx — the bulk of it

  • New Workflows group in Available tools
  • New section Triggering workflows from an AI assistant: the discover → trigger → poll flow (mermaid), the arg/return contract of each tool, the runState table, JSON examples for a parked and a finished run, an error table, and Identity, auditing, and limits covering the two v1 limitations PRD-742 asks for — no dedicated rate limiter and report-only human-gated runs

product/process/workflows/triggers.mdx — two triggers → three

  • Manual / Webhook / MCP table, channel-aware gating stated up front
  • MCP section: what the toggle exposes, what an assistant can and cannot do, three revocation levers
  • Fixes stale content that predates this work: the section is named Triggers (not Process), and the prerequisites for automated triggers (Forest Runtime installed + fallback inbox selected) were documented nowhere despite gating the webhook toggle too
  • Screenshot refreshed to show the MCP row

Aligned neighboursoverview.mdx, execute/workflows.mdx (automated runs land in the fallback inbox), forest-runtime.mdx (MCP triggering needs the Runtime too). Plus an unescaped pipe that broke a table in the webhook API reference.

Deviations from the spec, followed as implemented

  • listWorkflows returns no description — only workflowId, name, collectionName. The docs don't promise one.
  • getWorkflowRun is scoped to MCP-triggered runs (triggerType='mcp' in the store query): a manual or webhook run 404s, even for the same user. Not in the spec; documented as a <Warning>.
  • result is the terminal step ({ name, type, taskType?, context }), not a business payload.
  • runState returned by triggerWorkflow depends on the workflow's first step, so the docs tell readers not to treat it as an outcome.

No-regression verification (2nd AC of PRD-742)

Confirmed by reading the code, not by running it: MCP gating lives in startWorkflowRunFromMcp, webhook gating in workflow-webhook-route.ts:106, and the manual /start path has neither — startWorkflowRun is only touched by an audit-label refactor. Covered by should not gate the manual /start path (no regression) on an mcp-enabled workflow (workflow-orchestrator-endpoint.test.ts:1161). No symmetric webhook test exists, but the webhook channel never reads the mcp toggle.

Checks

mint broken-links passes.

🤖 Generated with Claude Code

Note

Document MCP trigger for workflows including tools, flow, and trigger settings

  • Adds a new 'Workflows' tools section to mcp-server.mdx describing listWorkflows, triggerWorkflow, and getWorkflowRun, plus a full guide covering the discover → trigger → poll flow, run state model, constraints, and human-in-the-loop behavior.
  • Restructures triggers.mdx to introduce a three-trigger model (Manual, Webhook, MCP) with a comparison table, UI guidance, prerequisites (Forest Runtime installed, fallback inbox selected), and a dedicated MCP trigger section.
  • Updates overview.mdx, forest-runtime.mdx, and workflows.mdx to reference MCP as an opt-in trigger source alongside webhooks.
  • Fixes a pipe-character escaping bug in the composite primary key example in trigger-workflow-webhook.mdx.
📊 Macroscope summarized 0a79255. 6 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

…RD-742)

Document the MCP channel added by PRD-49, written from the implementation
in the three feature branches rather than from the spec.

MCP server page: the three workflow tools (listWorkflows, triggerWorkflow,
getWorkflowRun) with their arg/return contracts, the discover -> trigger ->
poll flow, and the v1 limitations — no dedicated rate limiter, human-gated
runs are report-only.

Triggers page: goes from two triggers to three, states that gating is
channel-aware, and documents two prerequisites that were missing for the
webhook trigger too (Forest Runtime installed, fallback inbox selected).
The section is named Triggers, not Process. Screenshot refreshed with the
MCP row.

Deviations from the spec, followed as implemented: listWorkflows returns no
description; getWorkflowRun only exposes MCP-triggered runs; result is the
terminal step, not a business payload.

Also fixes an unescaped pipe that broke a table in the webhook reference.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
forest 🟢 Ready View Preview Aug 3, 2026, 1:57 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@linear-code

linear-code Bot commented Aug 3, 2026

Copy link
Copy Markdown

PRD-742

The record is **not** checked when the run is created — the orchestrator has no data access at that point. An id that does not exist, or that the user cannot read, produces a run that fails at its first data step; the assistant sees it through `getWorkflowRun`'s `error`, not as a trigger-time failure.
</Note>

Only **one run per record** can be active at a time. Triggering a record that already has an ongoing run fails and does **not** resume it — the run in flight is left untouched.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium embed/mcp-server.mdx:344

The documentation states "one run per record can be active at a time," but this is stricter than the actual behavior. The webhook trigger allows one active run per workflow per record — running a different workflow on the same record does not conflict. As written, the assistant would avoid triggering a second workflow on a record that already has any run in flight, when in fact only re-triggering the same workflow conflicts.

Suggested change
Only **one run per record** can be active at a time. Triggering a record that already has an ongoing run fails and does **not** resume it — the run in flight is left untouched.
Only **one run per workflow per record** can be active at a time. Triggering a record that already has an ongoing run of the same workflow fails and does **not** resume it — the run in flight is left untouched.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @product/embed/mcp-server.mdx around line 344:

The documentation states "one run per record can be active at a time," but this is stricter than the actual behavior. The webhook trigger allows one active run **per workflow per record** — running a different workflow on the same record does not conflict. As written, the assistant would avoid triggering a second workflow on a record that already has any run in flight, when in fact only re-triggering the *same* workflow conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants